package org.example.v4.action;

import org.example.v4.OrderStateMachine;
import org.example.v4.enums.Event;

/**
 * DeliveredStateAction 类表示订单的已交付状态。
 */
public class DeliveredStateAction extends AbstractOrderStateAction {
    @Override
    protected void handleInternal(OrderStateMachine context, Event event) {
    }

    @Override
    protected boolean isValidEvent(Event event) {
        return false; // 已交付状态下不接受任何事件
    }

    @Override
    protected void onInvalidEvent(OrderStateMachine context) {
        System.out.println("订单已交付。无法执行进一步操作。");
    }
}